Technical Q&As


QTMTB 47 - Saving QuickTime Movie Files (31-Jan-97)


Here is a series of questions and answers about some complications you might face in creating and saving QuickTime movies:

Q What is the proper way to save existing QuickTime movies after they have been edited?
A MoviePlayer is a good example:

In case 1, MoviePlayer calls CreateMovieFile (with the 'createMovieFileDontCreateMovie' flag set) and then calls AddMovieResource using the edited 'original' movie resource.

If the user selects option 2 above, 'create self contained', MoviePlayer calls FlattenMovie and creates a new movie file and resource. (The original file remains open, however.)

Q My application has a Movie resource from the original file which has been modified -- tracks have been added, as well as data (using data references). Should I choose option 1 or 2?
A Either method will work. If you use option 2 (FlattenMovie), the new file is interleaved, which is a good idea since we've got to write all the movie data to disk anyway. FlattenMovie optimizes the file for movie playback. (Be sure to flatten to a new file and don't try to overwrite the original file.)

Q What if I want to keep working with the new movie?
A If you want to work with the new flattened movie, FlattenMovieData is the way to go, since it automatically returns the new movie resource to you. (Use AddMovieResource to write this resource to the new file.)

Q If I use the FlattenMovieData/AddMovieResource method, can I close the original file? I want any further changes to take place in the new movie, not in the original one.
A Yes, you can close the file (and be sure to use DisposeMovie on your original movie resource, which still points back to the original file.)

One more note: going this route does not store the movie in the "fast start" format, so the movie will not be stored optimally for Web or CD playback. (Hard drives typically aren't affected by this.) If you want the file to be in the very best playback format for cross-platform play, use FlattenMovie with the 'flattenAddMovieToDataFork' flag set. You'll then need to open this movie just as you did the original (i.e., with OpenMovieFile/ NewMovieFromFile).


--Drew Colace
Worldwide Developer Technical Support

Technical Q&As
Previous Question | Contents | Next Question

To contact us, please use the Contact Us page.